{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Step1:\n",
    "- read data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>business_id</th>\n",
       "      <th>date</th>\n",
       "      <th>review_id</th>\n",
       "      <th>stars</th>\n",
       "      <th>text</th>\n",
       "      <th>type</th>\n",
       "      <th>user_id</th>\n",
       "      <th>cool</th>\n",
       "      <th>useful</th>\n",
       "      <th>funny</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>9yKzy9PApeiPPOUJEtnvkg</td>\n",
       "      <td>2011-01-26</td>\n",
       "      <td>fWKvX83p0-ka4JS3dc6E5A</td>\n",
       "      <td>5</td>\n",
       "      <td>My wife took me here on my birthday for breakf...</td>\n",
       "      <td>review</td>\n",
       "      <td>rLtl8ZkDX5vH5nAx9C3q5Q</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>ZRJwVLyzEJq1VAihDhYiow</td>\n",
       "      <td>2011-07-27</td>\n",
       "      <td>IjZ33sJrzXqU-0X6U8NwyA</td>\n",
       "      <td>5</td>\n",
       "      <td>I have no idea why some people give bad review...</td>\n",
       "      <td>review</td>\n",
       "      <td>0a2KyEL0d3Yb1V6aivbIuQ</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>6oRAC4uyJCsJl1X0WZpVSA</td>\n",
       "      <td>2012-06-14</td>\n",
       "      <td>IESLBzqUCLdSzSqm0eCSxQ</td>\n",
       "      <td>4</td>\n",
       "      <td>love the gyro plate.]Rice is so good and I als...</td>\n",
       "      <td>review</td>\n",
       "      <td>0hT2KtfLiobPvh6cDC8JQg</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>_1QQZuf4zZOyFCvXc0o6Vg</td>\n",
       "      <td>2010-05-27</td>\n",
       "      <td>G-WvGaISbqqaMHlNnByodA</td>\n",
       "      <td>5</td>\n",
       "      <td>Rosie, Dakota, and I LOVE Chaparral Dog Park!!...</td>\n",
       "      <td>review</td>\n",
       "      <td>uZetl9T0NcROGOyFfughhg</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>6ozycU1RpktNG2-1BroVtw</td>\n",
       "      <td>2012-01-05</td>\n",
       "      <td>1uJFq2r5QfJG_6ExMRCaGw</td>\n",
       "      <td>5</td>\n",
       "      <td>General Manager Scott Petello is a good egg!!!...</td>\n",
       "      <td>review</td>\n",
       "      <td>vYmM4KTsC8ZfQBg-j5MWkw</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              business_id        date               review_id  stars  \\\n",
       "0  9yKzy9PApeiPPOUJEtnvkg  2011-01-26  fWKvX83p0-ka4JS3dc6E5A      5   \n",
       "1  ZRJwVLyzEJq1VAihDhYiow  2011-07-27  IjZ33sJrzXqU-0X6U8NwyA      5   \n",
       "2  6oRAC4uyJCsJl1X0WZpVSA  2012-06-14  IESLBzqUCLdSzSqm0eCSxQ      4   \n",
       "3  _1QQZuf4zZOyFCvXc0o6Vg  2010-05-27  G-WvGaISbqqaMHlNnByodA      5   \n",
       "4  6ozycU1RpktNG2-1BroVtw  2012-01-05  1uJFq2r5QfJG_6ExMRCaGw      5   \n",
       "\n",
       "                                                text    type  \\\n",
       "0  My wife took me here on my birthday for breakf...  review   \n",
       "1  I have no idea why some people give bad review...  review   \n",
       "2  love the gyro plate.]Rice is so good and I als...  review   \n",
       "3  Rosie, Dakota, and I LOVE Chaparral Dog Park!!...  review   \n",
       "4  General Manager Scott Petello is a good egg!!!...  review   \n",
       "\n",
       "                  user_id  cool  useful  funny  \n",
       "0  rLtl8ZkDX5vH5nAx9C3q5Q     2       5      0  \n",
       "1  0a2KyEL0d3Yb1V6aivbIuQ     0       0      0  \n",
       "2  0hT2KtfLiobPvh6cDC8JQg     0       1      0  \n",
       "3  uZetl9T0NcROGOyFfughhg     1       2      0  \n",
       "4  vYmM4KTsC8ZfQBg-j5MWkw     0       0      0  "
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "data = pd.read_csv('dataset_food_online.txt' ,encoding=\"ISO-8859-1\")\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# step2:\n",
    "- clean data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>business_id</th>\n",
       "      <th>date</th>\n",
       "      <th>review_id</th>\n",
       "      <th>stars</th>\n",
       "      <th>text</th>\n",
       "      <th>type</th>\n",
       "      <th>user_id</th>\n",
       "      <th>cool</th>\n",
       "      <th>useful</th>\n",
       "      <th>funny</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>9yKzy9PApeiPPOUJEtnvkg</td>\n",
       "      <td>2011-01-26</td>\n",
       "      <td>fWKvX83p0-ka4JS3dc6E5A</td>\n",
       "      <td>5</td>\n",
       "      <td>my wife took me here on my birthday for breakf...</td>\n",
       "      <td>review</td>\n",
       "      <td>rLtl8ZkDX5vH5nAx9C3q5Q</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              business_id        date               review_id  stars  \\\n",
       "0  9yKzy9PApeiPPOUJEtnvkg  2011-01-26  fWKvX83p0-ka4JS3dc6E5A      5   \n",
       "\n",
       "                                                text    type  \\\n",
       "0  my wife took me here on my birthday for breakf...  review   \n",
       "\n",
       "                  user_id  cool  useful  funny  \n",
       "0  rLtl8ZkDX5vH5nAx9C3q5Q     2       5      0  "
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import re\n",
    "from nltk.tokenize import WordPunctTokenizer\n",
    "tok = WordPunctTokenizer()\n",
    "def cleaner(text):\n",
    "    letters_only = re.sub(\"[^a-zA-Z]\", \" \", text)\n",
    "    lower_case = letters_only.lower()\n",
    "    words = tok.tokenize(lower_case)\n",
    "    return (\" \".join(words)).strip()\n",
    "data['text']=data['text'].apply(lambda x: cleaner(x))\n",
    "data.head(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'review'}"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "set(data['type'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>business_id</th>\n",
       "      <th>review_id</th>\n",
       "      <th>stars</th>\n",
       "      <th>text</th>\n",
       "      <th>user_id</th>\n",
       "      <th>cool</th>\n",
       "      <th>useful</th>\n",
       "      <th>funny</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>9yKzy9PApeiPPOUJEtnvkg</td>\n",
       "      <td>fWKvX83p0-ka4JS3dc6E5A</td>\n",
       "      <td>5</td>\n",
       "      <td>my wife took me here on my birthday for breakf...</td>\n",
       "      <td>rLtl8ZkDX5vH5nAx9C3q5Q</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>ZRJwVLyzEJq1VAihDhYiow</td>\n",
       "      <td>IjZ33sJrzXqU-0X6U8NwyA</td>\n",
       "      <td>5</td>\n",
       "      <td>i have no idea why some people give bad review...</td>\n",
       "      <td>0a2KyEL0d3Yb1V6aivbIuQ</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>6oRAC4uyJCsJl1X0WZpVSA</td>\n",
       "      <td>IESLBzqUCLdSzSqm0eCSxQ</td>\n",
       "      <td>4</td>\n",
       "      <td>love the gyro plate rice is so good and i also...</td>\n",
       "      <td>0hT2KtfLiobPvh6cDC8JQg</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>_1QQZuf4zZOyFCvXc0o6Vg</td>\n",
       "      <td>G-WvGaISbqqaMHlNnByodA</td>\n",
       "      <td>5</td>\n",
       "      <td>rosie dakota and i love chaparral dog park it ...</td>\n",
       "      <td>uZetl9T0NcROGOyFfughhg</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>6ozycU1RpktNG2-1BroVtw</td>\n",
       "      <td>1uJFq2r5QfJG_6ExMRCaGw</td>\n",
       "      <td>5</td>\n",
       "      <td>general manager scott petello is a good egg no...</td>\n",
       "      <td>vYmM4KTsC8ZfQBg-j5MWkw</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              business_id               review_id  stars  \\\n",
       "0  9yKzy9PApeiPPOUJEtnvkg  fWKvX83p0-ka4JS3dc6E5A      5   \n",
       "1  ZRJwVLyzEJq1VAihDhYiow  IjZ33sJrzXqU-0X6U8NwyA      5   \n",
       "2  6oRAC4uyJCsJl1X0WZpVSA  IESLBzqUCLdSzSqm0eCSxQ      4   \n",
       "3  _1QQZuf4zZOyFCvXc0o6Vg  G-WvGaISbqqaMHlNnByodA      5   \n",
       "4  6ozycU1RpktNG2-1BroVtw  1uJFq2r5QfJG_6ExMRCaGw      5   \n",
       "\n",
       "                                                text                 user_id  \\\n",
       "0  my wife took me here on my birthday for breakf...  rLtl8ZkDX5vH5nAx9C3q5Q   \n",
       "1  i have no idea why some people give bad review...  0a2KyEL0d3Yb1V6aivbIuQ   \n",
       "2  love the gyro plate rice is so good and i also...  0hT2KtfLiobPvh6cDC8JQg   \n",
       "3  rosie dakota and i love chaparral dog park it ...  uZetl9T0NcROGOyFfughhg   \n",
       "4  general manager scott petello is a good egg no...  vYmM4KTsC8ZfQBg-j5MWkw   \n",
       "\n",
       "   cool  useful  funny  \n",
       "0     2       5      0  \n",
       "1     0       0      0  \n",
       "2     0       1      0  \n",
       "3     1       2      0  \n",
       "4     0       0      0  "
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = data.drop('date', 1)\n",
    "data = data.drop('type', 1)\n",
    "#data = data.drop('review_id', 1)\n",
    "#data = data.drop('business_id', 1)\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/raminm/anaconda3/envs/tensorflow/lib/python3.6/site-packages/sklearn/cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.\n",
      "  \"This module will be removed in 0.20.\", DeprecationWarning)\n",
      "Using TensorFlow backend.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Found 28625 unique tokens.\n"
     ]
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "from sklearn import preprocessing\n",
    "from sklearn.cross_validation import train_test_split as sk_split\n",
    "from keras.layers.embeddings import Embedding\n",
    "from keras.layers.recurrent import LSTM\n",
    "from keras.layers import Dropout\n",
    "from keras.models import Sequential\n",
    "from keras.layers import Dense\n",
    "from keras.preprocessing.text import Tokenizer\n",
    "from keras.preprocessing.sequence import pad_sequences\n",
    "import re\n",
    "max_fatures = 2000\n",
    "tokenizer = Tokenizer(num_words=max_fatures, split=' ')\n",
    "tokenizer.fit_on_texts(data['text'])\n",
    "sequences=tokenizer.fit_on_texts(data['text'].values)\n",
    "X = tokenizer.texts_to_sequences(data['text'].values)\n",
    "word_index = tokenizer.word_index\n",
    "print('Found %s unique tokens.' % len(word_index))\n",
    "X = pad_sequences(X,maxlen=200)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "15"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(data['text'][2].split())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " download: http://nlp.stanford.edu/data/glove.twitter.27B.zip"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "embeddings_index = {}\n",
    "f = open('/home/raminm/Desktop/subtask_B/glove.twitter.27B.200d.txt')\n",
    "for line in f:\n",
    "    values = line.split()\n",
    "    word = values[0]\n",
    "    coefs = np.asarray(values[1:], dtype='float32')\n",
    "    embeddings_index[word] = coefs\n",
    "f.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Found 1193514 word vectors.\n"
     ]
    }
   ],
   "source": [
    "embedding_dim = 200\n",
    "embeddings = 1 * np.random.randn(len(word_index) + 1, embedding_dim)\n",
    "embeddings[0] = 0  # So that the padding will be ignored\n",
    "print('Found %s word vectors.' % len(embeddings_index))\n",
    "for word, i in word_index.items():\n",
    "    embedding_vector = embeddings_index.get(word)\n",
    "    if embedding_vector is not None:\n",
    "        embeddings[i] = embedding_vector"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Save Weight"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy\n",
    "embeddings.dump(\"embeddings.dat\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# step3: refinment"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>business_id</th>\n",
       "      <th>stars</th>\n",
       "      <th>text</th>\n",
       "      <th>user_id</th>\n",
       "      <th>cool</th>\n",
       "      <th>useful</th>\n",
       "      <th>funny</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>9yKzy9PApeiPPOUJEtnvkg</td>\n",
       "      <td>5</td>\n",
       "      <td>my wife took me here on my birthday for breakf...</td>\n",
       "      <td>rLtl8ZkDX5vH5nAx9C3q5Q</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>ZRJwVLyzEJq1VAihDhYiow</td>\n",
       "      <td>5</td>\n",
       "      <td>i have no idea why some people give bad review...</td>\n",
       "      <td>0a2KyEL0d3Yb1V6aivbIuQ</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              business_id  stars  \\\n",
       "0  9yKzy9PApeiPPOUJEtnvkg      5   \n",
       "1  ZRJwVLyzEJq1VAihDhYiow      5   \n",
       "\n",
       "                                                text                 user_id  \\\n",
       "0  my wife took me here on my birthday for breakf...  rLtl8ZkDX5vH5nAx9C3q5Q   \n",
       "1  i have no idea why some people give bad review...  0a2KyEL0d3Yb1V6aivbIuQ   \n",
       "\n",
       "   cool  useful  funny  \n",
       "0     2       5      0  \n",
       "1     0       0      0  "
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.head(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmAAAAF1CAYAAABPmFZlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAG4VJREFUeJzt3X+w3XWd3/HnywTQAmtA7tKQxA3V6C66FZ2IdNXWxREC/gCn1oUZJVra7Hago1NbBTuzoBbr7qxSqcoUlyiuP2L8nRUqRqR12cqP4EYkIEsEnCQgiYYfsioKvPvH+WQ9xNzkJrn5nHtzn4+ZM/d73t/P9/t9f79n0Fe+P85JVSFJkqR+njTqBiRJkmYaA5gkSVJnBjBJkqTODGCSJEmdGcAkSZI6M4BJkiR1ZgCTtM8keVOSa0fdx95K8tIkt4+6D0n7DwOYNEMluTvJz5M8PPQ6atR9AST5P0n+XadtvSzJxp31UFV/U1XPnsC6LkjyyX3Rp6T9iwFMmtleXVWHDL3uGXVDkyHJ7FH3MNn2x32SZjIDmKTfkOQ1SdYleaCdCfq9oXm/12oPtDGvGZr3tCSrkjyU5AbgGTvZxpOTfDLJT9q6bkxyZJILgZcCH2pn5T7Uxn8wyYa27puSvHRoXRck+Xxb30PAm5Icl2RNG39fkg/sxfF4wlmyJO9IsinJT5PcnuTlSZYA7wT+qPX93Tb2qHZMtiZZn+TfD63nKUkuT3J/ktuSvH277dzdt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RFWdV1Xzq2ohg//P+2ZVvWHEbWmCkhzcHlwiycHAicBOvwlgSgawqnoU2PaTRbcBK/3JoukjyWeAbwPPTrIxyVmj7kkT9mLgjQz+9b22vU4ZdVOasLnANUluZvAP2dVV5dcZSPvekcC1Sb4L3ABcUVVf29kCU/JrKCRJkvZnU/IMmCRJ0v7MACZJktSZAUySJKkzA5gkSVJnBjBJkqTODGCSJEmdGcAkSZI6M4BJkiR19v8B96IkZ41nivAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 720x432 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sfig, ax = plt.subplots(1, 1, figsize=(10, 6))\n",
    "plt.hist(data['stars'],5)\n",
    "plt.xlim(0,5)\n",
    "plt.title('Food stars Histogram')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4174\n",
      "10000\n"
     ]
    }
   ],
   "source": [
    "unic_prod=list(set(data.business_id))\n",
    "unic_user=list(set(data.user_id))\n",
    "print(len(unic_prod))\n",
    "print(len(data.business_id))\n",
    "prod=[]\n",
    "user=[]\n",
    "for index, row in data.iterrows():\n",
    "    prod.append(unic_prod.index(row['business_id']))\n",
    "    user.append(unic_user.index(row['user_id']))\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>stars</th>\n",
       "      <th>text</th>\n",
       "      <th>cool</th>\n",
       "      <th>useful</th>\n",
       "      <th>funny</th>\n",
       "      <th>business_id</th>\n",
       "      <th>user_id</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5</td>\n",
       "      <td>my wife took me here on my birthday for breakf...</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>404</td>\n",
       "      <td>1236</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5</td>\n",
       "      <td>i have no idea why some people give bad review...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1311</td>\n",
       "      <td>1478</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4</td>\n",
       "      <td>love the gyro plate rice is so good and i also...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>267</td>\n",
       "      <td>2376</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>5</td>\n",
       "      <td>rosie dakota and i love chaparral dog park it ...</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>1308</td>\n",
       "      <td>4478</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>general manager scott petello is a good egg no...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>439</td>\n",
       "      <td>1845</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   stars                                               text  cool  useful  \\\n",
       "0      5  my wife took me here on my birthday for breakf...     2       5   \n",
       "1      5  i have no idea why some people give bad review...     0       0   \n",
       "2      4  love the gyro plate rice is so good and i also...     0       1   \n",
       "3      5  rosie dakota and i love chaparral dog park it ...     1       2   \n",
       "4      5  general manager scott petello is a good egg no...     0       0   \n",
       "\n",
       "   funny  business_id  user_id  \n",
       "0      0          404     1236  \n",
       "1      0         1311     1478  \n",
       "2      0          267     2376  \n",
       "3      0         1308     4478  \n",
       "4      0          439     1845  "
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = data.drop('business_id', 1)\n",
    "data = data.drop('user_id', 1)\n",
    "data['business_id']=prod\n",
    "data['user_id']=user\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(10000, 5)"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "col=['cool','useful','funny','business_id','user_id']\n",
    "m=data[col]\n",
    "m.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(10000, 205)"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'''import numpy as np\n",
    "out1= np.hstack((X, m))\n",
    "out1.shape'''"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "X_train, X_test, y_train, y_test = train_test_split(X,data['stars'], test_size=0.30, random_state=None)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(7000, 200)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_train.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(7000,)"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_train.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/raminm/anaconda3/envs/tensorflow/lib/python3.6/site-packages/ipykernel_launcher.py:14: UserWarning: Update your `LSTM` call to the Keras 2 API: `LSTM(250, recurrent_activation=\"hard_sigmoid\")`\n",
      "  \n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "embedding_3 (Embedding)      (None, None, 200)         5725200   \n",
      "_________________________________________________________________\n",
      "lstm_3 (LSTM)                (None, 250)               451000    \n",
      "_________________________________________________________________\n",
      "dropout_3 (Dropout)          (None, 250)               0         \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 1)                 251       \n",
      "=================================================================\n",
      "Total params: 6,176,451\n",
      "Trainable params: 451,251\n",
      "Non-trainable params: 5,725,200\n",
      "_________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "from keras import backend as K\n",
    "from keras.losses import mean_squared_error\n",
    "from keras.losses import mean_absolute_error\n",
    "from keras.losses import mean_absolute_percentage_error\n",
    "mse = MSE = mean_squared_error\n",
    "mae = MAE = mean_absolute_error\n",
    "mape = MAPE = mean_absolute_percentage_error\n",
    "def rmse (y_true, y_pred):\n",
    "    return K.sqrt(K.mean(K.square(y_pred -y_true), axis=-1))\n",
    "\n",
    "epochs = 20\n",
    "model = Sequential()\n",
    "model.add(Embedding(len(word_index)+1, 200,weights=[embeddings], mask_zero=True,trainable=False))\n",
    "model.add(LSTM(250, inner_activation = 'hard_sigmoid'))\n",
    "model.add(Dropout(0.5))\n",
    "model.add(Dense(1))\n",
    "model.compile(optimizer='adam', loss=mse, metrics=[mae,mape,rmse])\n",
    "model.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch 1/20\n",
      "7000/7000 [==============================] - 145s 21ms/step - loss: 2.0942 - mean_absolute_error: 1.1308 - mean_absolute_percentage_error: 45.5937 - rmse: 1.1308\n",
      "Epoch 2/20\n",
      "7000/7000 [==============================] - 153s 22ms/step - loss: 1.4795 - mean_absolute_error: 0.9817 - mean_absolute_percentage_error: 41.2035 - rmse: 0.9817\n",
      "Epoch 3/20\n",
      "7000/7000 [==============================] - 158s 23ms/step - loss: 1.3574 - mean_absolute_error: 0.9342 - mean_absolute_percentage_error: 38.6177 - rmse: 0.9342\n",
      "Epoch 4/20\n",
      "7000/7000 [==============================] - 176s 25ms/step - loss: 1.0865 - mean_absolute_error: 0.8307 - mean_absolute_percentage_error: 32.6245 - rmse: 0.8307\n",
      "Epoch 5/20\n",
      "7000/7000 [==============================] - 186s 27ms/step - loss: 0.9967 - mean_absolute_error: 0.7946 - mean_absolute_percentage_error: 30.6388 - rmse: 0.7946\n",
      "Epoch 6/20\n",
      "7000/7000 [==============================] - 191s 27ms/step - loss: 0.9118 - mean_absolute_error: 0.7574 - mean_absolute_percentage_error: 28.9962 - rmse: 0.7574\n",
      "Epoch 7/20\n",
      "7000/7000 [==============================] - 181s 26ms/step - loss: 0.8229 - mean_absolute_error: 0.7182 - mean_absolute_percentage_error: 26.9063 - rmse: 0.7182\n",
      "Epoch 8/20\n",
      "7000/7000 [==============================] - 205s 29ms/step - loss: 0.8216 - mean_absolute_error: 0.7142 - mean_absolute_percentage_error: 26.7128 - rmse: 0.7142\n",
      "Epoch 9/20\n",
      "7000/7000 [==============================] - 178s 25ms/step - loss: 0.7510 - mean_absolute_error: 0.6853 - mean_absolute_percentage_error: 25.3178 - rmse: 0.6853\n",
      "Epoch 10/20\n",
      "7000/7000 [==============================] - 176s 25ms/step - loss: 0.7226 - mean_absolute_error: 0.6661 - mean_absolute_percentage_error: 24.4465 - rmse: 0.6661\n",
      "Epoch 11/20\n",
      "7000/7000 [==============================] - 175s 25ms/step - loss: 0.6951 - mean_absolute_error: 0.6525 - mean_absolute_percentage_error: 23.8011 - rmse: 0.6525\n",
      "Epoch 12/20\n",
      "7000/7000 [==============================] - 176s 25ms/step - loss: 0.6456 - mean_absolute_error: 0.6321 - mean_absolute_percentage_error: 22.7648 - rmse: 0.6321\n",
      "Epoch 13/20\n",
      "7000/7000 [==============================] - 176s 25ms/step - loss: 0.6110 - mean_absolute_error: 0.6134 - mean_absolute_percentage_error: 22.0233 - rmse: 0.6134\n",
      "Epoch 14/20\n",
      "7000/7000 [==============================] - 174s 25ms/step - loss: 0.5793 - mean_absolute_error: 0.5969 - mean_absolute_percentage_error: 21.0491 - rmse: 0.5969\n",
      "Epoch 15/20\n",
      "7000/7000 [==============================] - 175s 25ms/step - loss: 0.5706 - mean_absolute_error: 0.5957 - mean_absolute_percentage_error: 20.9684 - rmse: 0.5957\n",
      "Epoch 16/20\n",
      "7000/7000 [==============================] - 174s 25ms/step - loss: 0.5221 - mean_absolute_error: 0.5691 - mean_absolute_percentage_error: 19.6678 - rmse: 0.5691\n",
      "Epoch 17/20\n",
      "2300/7000 [========>.....................] - ETA: 1:56 - loss: 0.4882 - mean_absolute_error: 0.5533 - mean_absolute_percentage_error: 19.1132 - rmse: 0.5533"
     ]
    }
   ],
   "source": [
    "#X_train, X_test, y_train, y_test \n",
    "hist=model.fit(X_train, y_train, epochs=20, batch_size=100, class_weight='balanced')\n",
    "# Final evaluation of the model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAEWCAYAAAB1xKBvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQ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H36xC5dJnYsWJiyKhzf7YTOYQwffjRYZNu3z603xhiTW0IHjLVri7bemEjZtm0b7du3p3379tSvX5/U1NSc1wcPBpsmI78BAwawbNmyAvd59tlnyQxTuWvXrl2ZO3duWM5lSoeELpJq1MgVQwVbb0xhMjNdbnTtWvedGTmy+EWZtWvXzrn5Pvjgg1SpUoW777471z6qiqqSlBT8d97LL79c6HX+9Kc/FS+BxpDgOYyRIyElJfe6lBS33piCZNd/rVkDqkfrv8LdaGLlypW0atWKPn360Lp1azZu3MjgwYNJT0+ndevWjBgxImff7F/8WVlZ1KhRg6FDh9KuXTu6dOnCL7/8AsC9997LU089lbP/0KFD6dixIy1atGDKlCkA/Prrr1x22WW0atWKyy+/nPT09EJzEuPGjaNNmzacfPLJDBs2DICsrCyuu+66nPVPP/00AE8++SStWrWibdu29O3bN7wfmImohM5hZP8avPtu2LQJ6tSBp56yCm8Dt98OBd0jp06F3/LMlrFvHwwcCC+8EPyY9u3d96uoli5dyquvvkp6ejoAo0aNolatWmRlZXHmmWdy+eWX06pVq1zH7Nq1i27dujFq1CjuvPNOxowZw9ChQ/OdW1WZPn06EyZMYMSIEXz66ac888wz1K9fn3fffZd58+aRlpZWYPrWr1/Pvffey8yZM6levTrnnHMOH374IXXr1mXr1q0sWLAAgJ07dwLw+OOPs2bNGipUqJCzzpQOCZ3DABcc1q2DypXhqqssWBh/8gaLwtaXRLNmzXKCBcD48eNJS0sjLS2NJUuWsHjx4nzHVKpUid69ewPQoUMHVq9eHfTcl156ab59vvvuO66++moA2rVrR+vWrQtM37Rp0zjrrLOoU6cOycnJXHvttXzzzTeccMIJLFu2jFtvvZWJEydSvXp1AFq3bk3fvn3JzMwsUScyE30JncPIVr48dOkC39rszcZTWE6gSZPg9V+NG8NXX4U3LZUrV855vmLFCv75z38yffp0atSoQd++fYO2ra9QoULO83LlypGVlRX03Mccc0yh+xRX7dq1mT9/Pp988gnPPvss7777LqNHj2bixIl8/fXXTJgwgUceeYT58+dTrly5sF7bREbC5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nSe8EFF9ChQwdat27Niy++CFBg2oP573//S6dOnTjllFPo0aNHrn3nzJlD586dOfHEExkzZgwAGzZsoGvXrrRv356TTz455z0Hm88j79+hffv2ud7Tww8/zJtvvsncuXO56qqrcnKDM2bMoFu3bnTo0IHevXuzefPmkOlfsWIFPXv2pEOHDpxxxhksX74cgL59+zJkyBA6duzIsGHDuPfee+nXrx+nn346119/Pfv376d///60adOGtLQ0vvnmGwBefPFFLr74Ys4880x69uwZ8rrFFclWUgK8BCxR1SdC7DYB6Oe1luoM7FLVjcBEoIeI1PQqu3t466IiIwO2bAHvb2dMflEc33zp0qXccccdLF68mNTUVEaNGsXMmTOZN28en332WdDBAbPnw5g3bx5dunTJuWHmlT0fxt/+9recm3n2fBiLFy/mvvvuY86cOSHT1rRpU+bNm0fnzp0ZOHAg77//PlOmTOG+++4D4OOPP2bt2rVMmzaNuXPnMmXKlJyb9NixY5k1axYzZszgiSeeYMeOHUVKO8AZZ5zB1KlTmTNnDpdeein/+Mc/crYtWLCAr776iu+//57777+fzZs3M27cOC644ALmzp3LvHnzaNu2bc58HpMnT2bOnDl8//33fPjhh4X8VZzsQJEdOFSV2267jXfffZdZs2bRt2/fnM8imMGDB/Pcc88xa9YsHn30UW6++eacbRs3bmTq1Kk8/vjjgPsefPHFF4wbN46nn36aY445hgULFvDaa69x3XXX5RRdzpkzh/fee48vvvjC13soikgWSZ0OXAcsEJHsnyfDgEYAqvo88DFwLrAS2AcM8LZtF5GHgBnecSNUdXsE05pLYD1GixbRuqqJK3E0vnmw+TBeeuklsrKy+Pnnn1m8eHG+CZTyzofxbYhKuVDzYfzf//0fUPh8GBdeeCEAbdq0ISsri8qVK1O5cmWSkpLYu3cvkyZN4pNPPuGUU04B3LAjy5cv57TTTuPJJ59kwoQJgJuE6ccff6R9+/a+0w6wdu1arrzySjZt2sRvv/1G8+bNc7ZdfPHFVKxYkYoVK3LGGWcwY8YMTj31VG688UYOHDjAxRdfTLt27Zg4cWLOfB5Aznwe559/fsjrh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+8ViTOEqicjcgNefqmp209qaIjIfl0u4xlt3C/CyiPwZ2AIM8NbfBowWkYG4nMQQ3EinwZQDxnlBRYCnVXVn2N6RMcVgdRjGFJNXh5GuqltjnRZjosGKpIwxxvhiOQxjjDG+WA7DGGOMLxYwjDHG+GIBwxhjjC8WMIwxxvhiAcMYY4wv/w/a+Qr3RfnRDgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "loss = hist.history['loss']\n",
    "mae = hist.history['mean_absolute_error']\n",
    "epochs = range(1, len(loss) + 1)\n",
    "plt.plot(loss, 'b-o', label='Training loss')\n",
    "plt.plot(mae, 'r-o', label='Training mean_absolute_error')\n",
    "plt.title('Training loss and mae')\n",
    "plt.xlabel('Epochs')\n",
    "plt.ylabel('loss and mae')\n",
    "plt.legend()\n",
    "plt.savefig(\"Lstm_model_propertis.png\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Save the weights\n",
    "model.save_weights('model_weights.h5')\n",
    "\n",
    "# Save the model architecture\n",
    "with open('model_architecture.json', 'w') as f:\n",
    "    f.write(model.to_json())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "load\n"
     ]
    }
   ],
   "source": [
    "from keras.models import model_from_json\n",
    "\n",
    "# Model reconstruction from JSON file\n",
    "with open('model_architecture.json', 'r') as f:\n",
    "    model = model_from_json(f.read())\n",
    "\n",
    "# Load weights into the new model\n",
    "model.load_weights('model_weights.h5')\n",
    "print(\"load\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
